<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
        <h:outputStylesheet name="css/cssLayout.css"/>

    </h:head>

    <h:body>
        <ui:composition template="./template/template.xhtml">

            <ui:define name="top">
                <h:outputText value="BIENVENIDO"></h:outputText>
            </ui:define>
            <ui:define name="left">
                <h:link outcome="datos/List" value="Ver todos los registros"/>
            </ui:define>

            <ui:define name="body">

                <h:dataTable id="dt1" value="#{datosController.items}" var="item" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" >

                    <h:outputText value="Datos" />

                </h:dataTable>

                <h:dataTable id="dt1" value="#{tableBean.perInfoAll}" var="item" bgcolor="lightblue" border="10" cellpadding="5" width="50%">

                    <f:facet name="header">
                        <h:outputText value="Datos" />
                    </f:facet>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="cedula" />
                        </f:facet>

                        <h:outputText value="#{item.cedula}"/>

                    </h:column>


                    <h:column>

                        <f:facet name="header">
                            <h:outputText value="Imagen"  />
                        </f:facet>
                        <img src="BuscarIMG?cedula=#{item.cedula}" width="150" height="140"></img>


                    </h:column>

                    <f:facet name="footer">
                        <h:outputText value="Fin de Lectura" />
                    </f:facet> 

                </h:dataTable> 
                
                 <h:form enctype="multipart/form-data">
                  cedula: <h:inputText value="cedula"  required="true" requiredMessage="Campo necesario"></h:inputText>
                  nombre: <h:inputText value="nombre"   required="true" requiredMessage="Campo necesario"></h:inputText>
                  foto: <h:inputFile value="file" ></h:inputFile> 
                  <h:commandButton value="Submit" action="controladorUploadImagen/FileUploadServer"/>
                </h:form>
                


                <form method="POST" enctype="multipart/form-data" action="FileUploadServer">
                    <table border="1">
                        <tr>
                            <td><h1>Ingresar a la base de datos</h1></td>
                        </tr>

                        <tr><td>Cedula</td>
                            <td><input type="text" value="" name="cedula"/></td></tr>

                        <tr><td>Nombre</td>
                            <td><input type="text" value="" name="nombre"/></td></tr>

                        <tr><td>Archivo</td>
                            <td>
                                <input type="file" name="file"/></td></tr>

                        <tr><td>Ingresar</td>
                            <td><input type="submit" value="Press"/></td></tr>

                    </table>
                </form>



            </ui:define>

        </ui:composition>

    </h:body>

</html>

